import { assetsBase, cardBase, companyBase, figureBase, ItemBase } from "./ItemBase";


export class ItemFactory {
    static create<T extends ItemBase>(data: any, item: any):T {
        let pItem = null;
        switch(data.bagType) {
            case 'assets':
                pItem = new assetsBase(item);
                break;
                case 'card':
                    pItem = new cardBase(item);
                    break;
                    case 'hero':
                        pItem = new figureBase(item);
                        break;
                        case 'company':
                            pItem = new companyBase(item);
                            break;
                            default:
                                break;
                      
        }
        return pItem;
    }
}
